import 'reflect-metadata'

function Controller() {
  return (target) => {

  }
}

class LoggerService {}

function Inject(token) {
  // 参数装饰器用于构造函数参数上时 接收3个参数
  // 类本身 undefined 索引( 从0开始 从左到右依次递增索引 )
  return (target, propertyName, paramIndex) => {
    console.log(target, propertyName, paramIndex)
  }
}

@Controller()
export class AppController {
  constructor(
    private loggerService: LoggerService,
    // 没有标识类型 design:paramtypes 会标识为 [Function Object] 也就是 Object
    @Inject('StringToken') private useValueService,
  ) { }
}

const design_paramtypes = Reflect.getMetadata('design:paramtypes', AppController)
console.log(design_paramtypes, design_paramtypes[1] === Object)